package com.hzmg.route.akka.msg;

import akka.actor.typed.ActorRef;
import com.hzmg.support.Command;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MsgDemo implements Command {
    private static final Logger logger = LoggerFactory.getLogger(MsgDemo.class);

    private final ActorRef<String> replyTo;

    public MsgDemo(ActorRef<String> replyTo) {
        this.replyTo = replyTo;
    }

    public void onMsg(String msg) {
        logger.info("---回复消息---" + msg);
        this.replyTo.tell(msg);
    }

}
